date_offset_get
Alias for DateTime::getOffset - Returns the time zone offset
date_offset_get()
function returns the time zone offset.
Returns the time zone offset in seconds for winter and summer in New York relative to UTC:
<?php $winter = date_create ( "2016-10-15" , timezone_open ( "America/New_York" ) ) ; $summer = date_create ( "2016-01-28" , timezone_open ( "America/New_York" ) ) ; echo date_offset_get ( $winter ) . " seconds.<br />" ; echo date_offset_get ( $summer ) . " Second." ; ?>
Try it yourself
date_offset_get ( object ) ;
parameter | describe |
---|---|
object | Required. Specifies the DateTime object returned by date_create() . |